﻿using System;
using System.Data.Common;
using System.Diagnostics;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Logging;

namespace pandx.Mulan.EntityFrameworkCore
{
    public static class MulanDbContextConfigurer
    {
        public static void Configure(DbContextOptionsBuilder<MulanDbContext> builder, string connectionString)
        {
            builder.UseSqlServer(connectionString);
            // builder.LogTo(msg =>
            // {
            //     Console.WriteLine(msg);
            // }, LogLevel.Information);
        }

        public static void Configure(DbContextOptionsBuilder<MulanDbContext> builder, DbConnection connection)
        {
            builder.UseSqlServer(connection);
            // builder.LogTo(msg =>
            // {
            //     Console.WriteLine(msg);
            // },LogLevel.Information);
        }
    }
}

